Skip to content

asio: the worker page, tests and texts under the -O3 release link - #4

Merged
pinhopro merged 2 commits into
mainfrom
release-link
Nov 15, 2026
Merged

pinhopro merged 2 commits into
mainfrom
release-link

Conversation

@pinhopro

Copy link
Copy Markdown
Contributor

Title: asio: the worker page, tests and texts under the -O3 release link

The superproject now links an emscripten program at its compile's level of optimization (webcpporg/webcpp#18): -O3 in a release build. This brings asio's browser worker page, its tests and its texts to that link.

Changes

  • test/browser/worker_page.html. browser_worker_move_failure never polls, so its -O3 link drops webcpp_asio_main_poll and Emscripten's doPollAsync with it, and the page's preRun threw missing pinned SDK doPollAsync. The page now exempts the program from its poll watch, as run.mjs exempts it from its poll check (and as the page already exempted the pthread return probe). With the old page, the release browser-worker-exceptions lane fails in both variants; with the new one, it passes.
  • test/Jamfile. asyncify_stack_optimized_link_* and bridge_optimized_link_exceptions_* linked release with <linkflags>-O3, which release now does itself: their .wasm files are byte-identical to the release builds', and their .js files differ only in the program's name. asyncify_stack keeps its debug and release builds. The two bridge tests stay, without the flag, as bridge_release_exceptions_on/off: the emscripten lane builds debug, b2's default, and they are the bridge's only release build there, where the link drops the native stack helpers the bridge's JavaScript calls unless asio exports them.
  • The Asyncify stack, measured again. With asyncify_stack (Emscripten 6.0.11), debug is now the deepest build: at most 1,168 bytes with exceptions and 848 without, against 388 and 304 in release. With a 2048-byte stack no test of the asyncify lane trapped in debug or release, so the 2026-10-11 rule alone would now give 4096. The size stays 8192: it is the default and the floor that the libraries built on asio and their programs are tested and measured against, and lowering it would make a program whose frames fit only the larger stack trap at run time. build.jam, AGENTS.md and the guide restate the reason with the new numbers; AGENTS.md and doc/cobalt.adoc add Cobalt's probe (1,036 bytes in debug, 384 in release).
  • Texts. README.md and doc/testing.adoc build release sizes with variant=release alone, and say how another level reaches both the compile and the link; doc/building.adoc, doc/cobalt.adoc and AGENTS.md no longer say b2 links a release build without optimization. One changelog line.

Decision for the owner

Lowering the default Asyncify stack to 4096 is now possible by asio's own tests alone. It is left at 8192 here; doing it would be a breaking change of its own, measured across Cobalt, Beast and Trystero (Trystero's debug room test saves 2,344 bytes on its webrtc branch, more than half of 4096).

Verification

Local, macOS arm64, Emscripten 6.0.11, Node 26.13.0, each lane from scratch (b2 -a) in its own build directory, with the CI's options, in variant=release and variant=debug, verdict by tools/report/report.py; the browser lanes with chrome-headless-shell 1248:

  • emscripten (libs/asio/test libs/asio/example): passed, release and debug (113 tests and examples).
  • asyncify, tls, browser, browser-concurrency-hint, browser-workers, browser-worker-exceptions: passed, release and debug.
  • b2 -a libs/asio/doc: passed. The superproject's tools/lint/lint.sh: clean.

No CI was run.

Depends on webcpporg/webcpp#18 (merged).

🤖 Generated with Claude Code

The superproject links an emscripten program at its compile's level of
optimization (webcpporg/webcpp#18), -O3 in a release build.
browser_worker_move_failure never polls, and its -O3 link drops
webcpp_asio_main_poll and Emscripten's doPollAsync with it, so
worker_page.html threw "missing pinned SDK doPollAsync" in preRun. The
page now exempts it from the poll watch, as run.mjs exempts it from the
poll check and the page already exempted the pthread return probe.

bridge_optimized_link_exceptions_on/off and
asyncify_stack_optimized_link_* linked release with <linkflags>-O3,
which release now does itself: their .wasm files are byte-identical to
the release builds', and their .js files differ only in the program's
name. asyncify_stack keeps its debug and release builds. The bridge's
two are kept, without the flag, as bridge_release_exceptions_on/off:
the emscripten lane builds debug, and they are the bridge's only
release build there, whose link drops the stack helpers the bridge's
JavaScript calls unless asio exports them.

Measured again with asyncify_stack (Emscripten 6.0.11): debug, now the
deepest build, wrote at most 1,168 bytes with exceptions and 848
without; release 388 and 304. With a 2048-byte stack no test of the
asyncify lane trapped in debug or release, so the 2026-10-11 rule alone
would now give 4096. The size stays 8192, the default and the floor
that the libraries built on asio and their programs are tested
against; build.jam, AGENTS.md and the guide say why, with the new
numbers, and Cobalt's probe's.

The README and the testing guide build release sizes with
variant=release alone, and no text says b2 links a release build
without optimization.
@pinhopro
pinhopro merged commit 05c846c into main Nov 15, 2026
42 checks passed
@pinhopro
pinhopro deleted the release-link branch November 17, 2026 04:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant